﻿<%@ page language="java" import="java.util.*,java.sql.ResultSet,com.knife.domain.BlogNewsDir,com.knife.db.ComDAL" pageEncoding="UTF-8"%>
<%
if(request.getParameter("username")!=null){
String userName=request.getParameter("username");
int total=0;
String sqlstr="select count(*) as counts from blognewsdoc where inputuser='"+userName+"'";
ComDAL theDAL = null;
try{
	theDAL = new ComDAL();
	ResultSet rs=theDAL.DoSelect(sqlstr);
	if(rs!=null){
		total= rs.getInt("counts");
	}
}catch(Exception ex){
}finally{
theDAL.close();
}
%>
document.write("<li><a href=\"/<%=userName %>/index.htm\">全部文章[<%=total%>]</a></li>");
<%
BlogNewsDir dirs=new BlogNewsDir();
Vector<BlogNewsDir> vt=new Vector<BlogNewsDir>();
vt=dirs.getListAll(" inputuser='"+userName+"'");
for(int i=0;i<vt.size();i++){
BlogNewsDir dir=(BlogNewsDir)vt.get(i);
%>
document.write("<li><a href=\"/blog.do?parameter=listDoc&dir=<%=dir.getCid()%>&user=<%=userName%>\"><%=dir.getTitle()%>[<%=dirs.getCountOfDir(dir) %>]</a></li>");
<%
}
}
%>